package com.example.demo.controller;

import com.example.demo.model.User;
import com.example.demo.service.serviceimpl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserServiceImpl usi;

    @RequestMapping("/register")
    public String reg(User user){
        boolean insert = usi.insert(user);
        if (insert){
            return "ok.html";
        }else {
            return "register.html";
        }
    }
}
